package com.dk.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {


//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121699393";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCqU6p6zalXvZdXleZPlbDUNzZYkMvEaBVBpIV7REbpjOqnceLAicvucFMaIzQlYOvRf4aIh1La8yKp6biRw/bAEufB16FsUAaRdkgbiEhRdWgQSCqWxUL5CeOxS+za1J5+uflgu6n/Pjnbihq9VvlU9i6ENgJ+2vYfHob6j0yOBX5xfkv0pNBDo6HcJSFQcvZYMCH0cwGMXRuum7JOJJz1F7GJvh81T6Zl0KoV3WVbUovTDqDVAvWy005TY/4y8iUI0DZyk6Af/aDcm9tu0yMsnZhpi2LuEikC0reWydEFS0eVqYU4oMdaA3Rouy5FCF3Apye/dlxThMoRdiGj5lkdAgMBAAECggEALkeDZ9CftZ5nE75AENm8bTz/QDs/koMxW1+ngSHBHs5SJ+MS2HvYdFYCznRIQ+u8x3SeClSyl5k+jupZYwna7r90R0AetT5dOoLn/ssd0zxSZTImmEbK9r3QJylZFvB0jDxd3QHApAC1WciBkXajUol9hCDktrEp9LSnukbbZy710Mxi+2BV9ELlCIXQr4FKKFJ3xhoZXLTLcf+rriLM3ZzcsffIOtXRHdWFBqcxb9oVEG+jNA2U6h5O0e8cibTu6BV00MmPIaNOlW6yG4KtgQwQcQfkcV2/HpMe8JXyicD2DsT/HlFUiYCBwn3T9hR81aNBvj4CYLtlVUIlSeflpQKBgQD351qs0yjA6zsrnyfVxpEea3yvIUzteCAOgHJDk5pAg26KzhmtcfbxUzlG5trdqPUYD235HUojeD7PLwa2fUt4PMmHbJDR25k2SMK6qdhpeF5qRyZCPAoBePyXPYSgyojD4Np+gON+S0EAObmYMjMxExtk8PgitWBKPuB2OqGDawKBgQCv47ckA9YCFO10E2aZVsKbw9zzpKv5J6igr1FGKU2xW/iBIk/AF03ILw/R/oPm1sIwSdXS+wkDV8LKGNI18WgoYEFw/Gbz4yTpp2y8nuZEgwrt8UfSZeRSUWCBgiiFJ7CISCa88rRufwJ30iQKNQrBqI5X3jXCXpaAwxR9cv+/lwKBgQCCn2Dj14+Nt2TCI2Z1+d7VTIWyMbW7GqSpf3y1pryMabSBZv+YqIgZuGRhu5pvWWtrdhXYQVqjPeS6fmjnFzYA8OaveMEGEtO0CrqwaHYjfM0i6sJ5+/C5veo6Nqv/nThbHcuDBJ7aGQTy/XeRfkIDBbJVibL1duR5uo/DPDmGaQKBgAHeMTu4rrUm876f1h8axMZSti4AObNTsH7EXeCY37Jaf7EfZCluFe1iUpCwW0ZAUZ+hqRusftQCQpdS3Cimf6yuGQPSKmW8q8+vb4AxT9C6c4tDXLfnTR1yr8uwTi3b1gwceAzZpwDlaGlNWgShu5OC7sAQJBIEXyTO7ZDHf9/RAoGBAOGU7W77T8USybN0najFNo8ktQhFUf0msPMLFVnCeaXXj47s8jTntiVOr5fzXCWNmm+EKg1PFUKOqbwj3V9Q75PhzGi+VSW+K+GYZzFCc7XWr1mNJUahCCBwLm0BoQ4UOXVJw/A4Qpnu9KGFFtlt9wQF7gOY3E4W0/q2QrQfmaJl";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhSnLBkncVrN9EWKXBaT4QhAnNiwbuItKgGuuxPfxpRea2yKgTx/zFQIxBSKn9wXosGRwdy/p6WS/b0xCfbPcPkPsMiDev1t3fPqGLzlD7QlDmieifs4vc7ZAhrGD5ESbYxQ+kxAZ/Sr0qDZQXogZKFLLb8ygdpnSr3SaRy8iOBr3wweCajYjOdEcn4PH3ARoicUOXn5PgwPI4ohk5AkywosYLlmuBVRHZggFJgLtRzLg8MJdp6rBpjgWKTAmbwSobqUZTuEBMls7UBrLCq2UP03W1hhuuu4snNaWz1mV1V4zLyf82pQJCxc6PAr64Qu/8mBwrJ4oXY6FG5Yo6BoklwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://33861b55.r2.cpolar.top/alipayCallback/notify_url";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://33861b55.r2.cpolar.top/alipayCallback/return_url";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志打印路径
    public static String log_path = "E:\\logs";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

